/**
 * Copyright (c) 2017, Alex. All rights reserved.
 */
package com.oschina.bottle.redis;

import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.util.StringUtils;

import java.lang.reflect.Method;

/**
 * 默认缓存key生成规则
 *
 * @author <a href="mailto:zhongchao@gegejia.com">zhong</a>
 * @version 1.0 2017/9/28
 * @since 1.0
 */
public class DefaultKeyGenerator implements KeyGenerator
{
    @Override
    public Object generate(Object target, Method method, Object... params)
    {
        return StringUtils.arrayToDelimitedString(params, "_");
    }
}
